import { defineStore } from 'pinia';
import { ref } from 'vue';

const useRouterStore = defineStore(
  'router',
  () => {
    const currentPath = ref<string>();
    const isInRouter = ref<boolean>(false);

    const setCurrentPath = (tokenValue: string) => {
      currentPath.value = tokenValue;
    };

    const setIsInRouter = (tokenValue: boolean) => {
      isInRouter.value = tokenValue;
    };

    return {
      currentPath,
      setCurrentPath,
      isInRouter,
      setIsInRouter
    };
  },
  {
    persist: true
  }
);

export default useRouterStore;
